<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page isELIgnored="false"%>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/3/21
  Time: 15:02
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--  BootStrap--%>
<link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<html>
<head>
    <title>增加订单</title>
    <script src="${pageContext.request.contextPath}/js/jquery-3.6.0.js" charset="UTF-8"></script>
    <script charset="UTF-8">
        function a4() {
            $.post({
                url:"${pageContext.request.contextPath}/a4",
                data:{"name":$("#bkname1").val()},
                success:function (data) {
                    if (data == null) {

                    } else {
                        $("#addstock").css("color", "red");
                        $("#addstock").html(data);
                    }
                }
            })
        }

    </script>
</head>
<body style="background-color:#e7e7e7 ">
<div class="container" style="background-color: #e7e7e7">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <div class="page-header">
                <h1>
                    <small>新增订单</small>
                </h1>
            </div>
        </div>
        <div>
            <form action="${pageContext.request.contextPath}/stock/addstock" method="post">
                <div class="form-group" style="display: none">
                    <label for="bkname">商品编号</label>
                    <input type="text" name="id" class="form-control" id="bkname">
                </div>

                <div class="form-group" >
                    <label for="bkname1">商品名称</label>
                    <span id="addstock"></span>
                    <input type="text" onblur="a4()" name="name" class="form-control" id="bkname1" required>
                </div>

                <div class="form-group">
                    <label for="bkname2">商品进价</label>
                    <input type="text" name="price" class="form-control" id="bkname2" required>
                </div>

                <div class="form-group">
                    <label for="bkname3">商品数量</label>
                    <input type="text" name="number" class="form-control" id="bkname3" required>
                </div>
                <div class="form-group">
                    <label for="bkname8">商品售价</label>
                    <input type="text" name="saleprice" class="form-control" id="bkname8" required>
                </div>
<%--                <div class="form-group">--%>
<%--                    <label for="bkname4">供货商</label>--%>
<%--                    <input type="text" name="sume" class="form-control" id="bkname4" required>--%>
<%--                </div>--%>
                <div class="form-group">
                    <label for="bkname4">供应商名称</label>
                    <select id="productname" name="sume" id="bkname4" onblur="a()">
                        <c:forEach var="product" items="${supplier}">
                            <option value="${product.company}">${product.company}

                            </option>
                        </c:forEach>
                    </select>
                </div>
<%--                <div class="form-group">--%>
<%--                    <label for="bkname4">供货商</label>--%>
<%--                    <input type="text" name="sume" class="form-control" id="bkname4" required>--%>
<%--                </div>--%>


                <div class="form-group" style="display: none">
                    <label for="bkname6">电话</label>
                    <input type="text" name="tellpone" value="123456" class="form-control" id="bkname6" >
                </div>
                <div class="form-group">
                    <label for="bkname7">备注</label>
                    <input type="text" name="detail" class="form-control" id="bkname7" required>
                </div>
                <div class="form-group">
                    <input type="submit" class="form-control" value="添加">
                </div>

            </form>
        </div>
    </div>
</div>
</body>
</html>
